// includes()
const message = "Error: foo is not defined.";
console.log(
  message.startsWith("Error"), // 开始
  message.includes("foo"), // 任意位置
  message.endsWith(".") // 结尾
);
